/*
 * @Author: 陈俊升 761723995@qq.com
 * @Date: 2023-10-09 15:08:15
 * @LastEditors: 陈俊升 761723995@qq.com
 * @LastEditTime: 2023-10-20 15:25:23
 * @FilePath: /hr_new_vue3/src/apis/management/human/baseSetting/certificateSetting/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/* 人事-基础设置-开具证明模板设置api */

import { ajaxService } from '@/utils/request';

const env = import.meta.env;
// const baseURL = env.VITE_APP_BASE_URL;
const baseURL = env.VITE_DEV_BASE_URL;
const baseURL2 = env.VITE_APP_BASE_URL;

// 获取实习开具证明模板列表
export function GetInternshipProofTemplate(params: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/to_prove_way/to_practice',
    method: 'get',
    baseURL,
    params
  });
}

// 新增实习开具证明模板列表
export function PostInternshipProofTemplate(data: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/to_prove_way/to_practice',
    method: 'post',
    baseURL,
    data
  });
}

// 修改实习/离职开具证明模板列表
export function PutInternshipProofTemplate(data: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/to_prove_way/to_practice',
    method: 'put',
    baseURL,
    data
  });
}

// 查重实习/离职开具证明模板
export function CheckInternshipProofTemplate(params: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/to_prove_way/to_practice/repeat',
    method: 'get',
    baseURL,
    params
  });
}

// 修改实习/离职开具证明模板列表默认模板状态
export function PutInternshipProofTemplateState(data: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/to_prove_way/to_practice/status',
    method: 'put',
    baseURL,
    data
  });
}

// 删除实习/离职开具证明模板列表
export function DelInternshipProofTemplate(data: any) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/to_prove_way/to_practice',
    method: 'delete',
    baseURL,
    data
  });
}

// 转换实习/离职证明开具方式
export function ChangeInternshipProofTemplate(params: {
  id: number; //实习/离职模板id
  ownerId: number; // 人员id
}) {
  return ajaxService({
    url: '/hr/personnel_matters/basic_setting/to_prove_way/to_practice/text',
    method: 'get',
    baseURL,
    params
  });
}
